
package com.server;

import com.domain.DoorCar;
import com.domain.DoorDevice;
import com.repository.CarRepo;
import com.repository.DeviceRepo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class CarServer {
 @Resource
    public CarRepo carRepo;


/*    public void updateModel(DoorCar car){
       carRepo.updateByName(model,department);
        carRepo.save(car);
        carRepo.findAll();
    }*/
    public void save(DoorCar car){
     carRepo.save(car);
    }
    public DoorCar findByDepartment(String department){
        System.out.println("QEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEETTTTTTTT"+department);
       return carRepo.findByDepartment(department);
    }
    public void updateByCar(String model,String department,String name,String starttime,String stoptime,int id){
        carRepo.updateDoorCarById(model,department,name,starttime,stoptime,id);
    }
}

